<div class="portlet">
    <div class="portlet-actions">
        <button class="btn blue btn-sm" ng-click="grid.add()"><i class="fa fa-plus"></i> 新增</button>
    </div>
    <form class="portlet-search-body" name="queryForm">
        <input type="text" class="form-control search-item" ng-model="adName" placeholder="广告名称">
        <select class="form-control search-item" ng-model="customerId"
                ng-options="opt.customerId as opt.customerName for opt in customerList">
            <option value="" disabled selected hidden>-- 所属客户 --</option>
        </select>
        <select class="form-control search-item" ng-model="status"
                ng-options="opt.value as opt.name for opt in options.ad_design_status">
            <option value="" disabled selected hidden>-- 状态 --</option>
        </select>
        <div class="search-item">
            <button class="btn btn-icon-only default"><i class="fa fa-chevron-right"></i></button>
            <button class="btn btn-sm query" ng-click="grid.query();"><i class="fa fa-search"></i> 查询</button>
            <button class="btn btn-sm reset" ng-click="grid.reset();"><i class="fa fa-eraser"></i> 重置</button>
        </div>
    </form>
    <div class="portlet-body">
        <table ed-grid="grid"  class="table table-striped table-bordered table-advance table-hover"
               data-options="url: 'adDesign/query.do', modelText: '广告', form: 'queryForm', modal: 'modal'">
            <thead>
            <tr>
                <th data-options="field: '_index'" ></th>
                <th data-options="field: 'adId'" >编号</th>
                <th data-options="field: 'adName'" >广告名称</th>
                <th data-options="field: 'customerId'" >所属客户</th>
                <th data-options="field: 'sampleData'" style="width: 25%" >样刊工艺</th>
                <th data-options="field: 'sampleSource | code : sample_source'" >样刊来源</th>
                <th data-options="field: 'path'">确认稿</th>
                <th data-options="field: 'printPrecision'" >打印精度</th>
                <th data-options="field: 'machineNo'" >机器编号</th>
                <th data-options="field: 'status | code : ad_design_status'">状态</th>
                <th data-options="field: 'remark'">备注</th>
                <th data-options="field: 'makeTime | limitTo : 10'">日期</th>
                <th>操作</th>
            </tr>
            </thead>
        </table>
    </div>
</div>

<div ed-modal="modal" data-options="title: '广告信息编辑', static: true, width: 720, defaultButton:false,onHidden:'reset'">
    <form action="#" class="form-horizontal w5c-form" w5c-form-validate novalidate name="validateForm">
        <div class="form-body">
			<div class="form-group">
				<label class="col-md-2 control-label">广告名称</label>
				<div class="col-md-4">
					<input type="text" class="form-control" name="adName" ng-model="adDesign.adName" ng-disabled="viewFlag" required>
				</div>
                <label class="col-md-2 control-label">所属客户</label>
                <div class="col-md-4">
                    <select class="form-control" name="customerId" ng-model="adDesign.customerId" ng-disabled="viewFlag" required
                            ng-options="opt.customerId as opt.customerName for opt in customerList">
                    </select>
                </div>
			</div>

            <div class="form-group">
                <label class="col-md-2 control-label">样刊来源</label>
                <div class="col-md-4">
                    <select class="form-control" ng-model="adDesign.sampleSource" name="sampleSource" ng-disabled="viewFlag"
                            ng-options="opt.value as opt.name for opt in options.sample_source" required></select>
                </div>
                <label class="col-md-2 control-label">打印精度</label>
                <div class="col-md-4">
                    <input type="text" class="form-control" name="printPrecision" ng-disabled="viewFlag" ng-model="adDesign.printPrecision" required>
                </div>
            </div>

            <div class="form-group">
                <label class="col-md-2 control-label">机器编号</label>
                <div class="col-md-4">
                    <input type="text" class="form-control" name="machineNo" ng-disabled="viewFlag" ng-model="adDesign.machineNo" required>
                </div>
                <label class="col-md-2 control-label">状态</label>
                <div class="col-md-4">
                    <select class="form-control" ng-model="adDesign.status" name="status" ng-disabled="viewFlag"
                            ng-options="opt.value as opt.name for opt in options.ad_design_status" required></select>
                </div>
            </div>
			<div class="form-group">
				<label class="col-md-2 control-label">样刊工艺</label>
				<div class="col-md-10">
					<textarea rows="3" class="form-control" name="sampleData" ng-disabled="viewFlag" ng-model="adDesign.sampleData"></textarea>
				</div>
			</div>
			<div class="form-group">
				<label class="col-md-2 control-label">备注</label>
				<div class="col-md-10">
					<textarea rows="2" class="form-control" name="remark" ng-disabled="viewFlag" ng-model="adDesign.remark"></textarea>
				</div>
			</div>
			<div class="form-group">
				<label class="col-md-2 control-label">确认稿</label>
				<div class="col-md-10">
                    <div ed-uploader ng-show="!viewFlag" data-options="text:' 上传附件',accept:'image/*'" class="ng-uploader" ng-model="adDesign.file"></div>
                    <div class="mix-grid" style="display: block;" ng-show="adDesign.file != undefined && adDesign.file.path != undefined && adDesign.file.path != ''">
                        <div class="mix" style="display: inline-block;opacity: 1;padding-right: 5px;" >
                            <div class="mix-inner">
                                <img class="img-responsive" ng-src="{{setting.nginxPath + adDesign.file.path}}" alt="" style="width:150px;height:120px">
                                <div class="mix-details" style="height:50%;">
                                    <a ng-show="!viewFlag" style="right: 67%" class="mix-link" ng-click="removeImg();">
                                        <i class="fa fa-close" ></i>
                                    </a>
                                    <a ng-style="{'left': viewFlag ? '16%' : '35%'}" style="width: 41px;padding-left: 12px;" class="mix-link"
                                       href="adDesign/downloadFile.do?adId={{adDesign.adId}}&filePath={{adDesign.file.path}}">
                                        <i class="glyphicon glyphicon-download-alt"></i>
                                    </a>
                                    <a ng-style="{'left': viewFlag ? '50%' : '64%'}"class="mix-preview fancybox-button" ng-href="{{setting.nginxPath + adDesign.file.path}}" data-rel="fancybox-button">
                                        <i class="fa fa-search"></i>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
				</div>
			</div>
        </div>
        <div class="form-actions" ng-show="!viewFlag">
            <button type="button" class="btn default" ng-click="grid.cancel();">
                <i class="fa fa-times"></i> 取消
            </button>
            <button type="button" class="btn blue" ng-click="grid.save();">
                <i class="fa fa-times"></i> 确定
            </button>
        </div>
        <div class="form-actions" ng-show="viewFlag">
            <button type="button" class="btn blue" ng-click="grid.cancel();">
                <i class="fa fa-times"></i> 确定
            </button>
        </div>
    </form>
</div>

<!--<div ed-tips="sampleUrlTip" data-options="direction:'right',width:'300px'" >-->
    <!--<div style="padding:24px 0px 7px 0;height: 66px;" >-->
        <!--<div class="mix-grid" style="display: block;">-->
            <!--<div class="mix" style="display: inline-block;opacity: 1;padding-right: 5px;" >-->
                <!--<div class="mix-inner">-->
                    <!--<img class="img-responsive" ng-src="{{setting.nginxPath + adDesign.path}}" alt="" style="width:150px;height:120px">-->
                    <!--<div class="mix-details" style="height:50%;">-->
                        <!--<a style="left: 33%" class="mix-preview fancybox-button" ng-href="{{setting.nginxPath + adDesign.path}}" data-rel="fancybox-button">-->
                            <!--<i class="fa fa-search"></i>-->
                        <!--</a>-->
                    <!--</div>-->
                <!--</div>-->
            <!--</div>-->
        <!--</div>-->
    <!--</div>-->
<!--</div>-->